/**
 * <p>Copyright (c) 2011 深圳市鹏途信息技术有限公司 </p>
 * <p>				   All right reserved. 		     </p>
 * 
 * <p>项目名称 ： 	东莞交通工程质量监督综合业务系统        </p>
 * <p>创建者   :	libitum 
 * 
 * <p>描   述  :   ApplPetition.java for com.pengtu.entity.business    </p>
 * 
 * <p>最后修改 : $: 2011-7-12-下午04:10:17 v 1.0.0	 libitum   $     </p>
 * 
*/

package com.pengtu.entity.business;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;

import org.hibernate.annotations.Where;

import com.pengtu.entity.IdEntity;
import com.pengtu.entity.app.Attachment;

/**
 * 
 * 业务受理的各种申请表的基类
 * PetitionBasic
 * 
 * 2011-9-17 下午04:23:51
 * 
 * @version 1.0.0
 *
 */
@MappedSuperclass
public abstract class BasicPetition extends IdEntity {

	/**
	 * serialVersionUID:
	 *
	 * @since 1.0.0
	 */
	
	private static final long serialVersionUID = 1L;
	
	private String projId;//工程
	private String content;//内容
	private String orgName;//申请单位
	private String contact;//联系人
	private String phone;//联系电话
	private String email;//email
	private Date prepareDate; //申请时间
	private String remark;//备注
	private String petitionFile; // 附件资料
	private Set<Attachment> attachments =  new HashSet<Attachment>(0);
	
	@Column(name="PROJID")
	public String getProjId() {
		return projId;
	}
	public void setProjId(String projId) {
		this.projId = projId;
	}
	
	@Column(name="ORGNAME")
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	
	
	@Column(name="PHONE")
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Column(name="EMAIL")
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Column(name="CONTACT")
	public String getContact() {
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	
	@Column(name="REMARK")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@Column(name="CONTENT")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@Column(name="PREPAREDATE")
	public Date getPrepareDate() {
		return prepareDate;
	}
	public void setPrepareDate(Date prepareDate) {
		this.prepareDate = prepareDate;
	}
	@Column(name="PETITIONFILE")
	public String getPetitionFile() {
		return petitionFile;
	}
	public void setPetitionFile(String petitionFile) {
		this.petitionFile = petitionFile;
	}
	@OneToMany(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
	@JoinColumn(name = "TABLEID")
	@Where(clause=" delFlag = 0")
	public Set<Attachment> getAttachments() {
		return attachments;
	}
	public void setAttachments(Set<Attachment> attachments) {
		this.attachments = attachments;
	}
//	@Transient
//	public void setAttachment(Attachment attachment) {
//		attachments.add(attachment);
//	}
	
}
